#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod=998244353,inf=0x3f3f3f3f3f3f3f3f;
const int N=1e5+10,M=2e5+10;
mt19937 rnd(time(0));
int fa[N];
int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
vector<int>e[N],t[N];
int n,m,k;
int is[N],vis[N];
vector<pair<int,int>>E;
void dfs(int x)
{
	if(vis[x])return;
	for ( auto v:e[x] )E.push_back({v,x});
	vis[x]=1;
	for ( auto v:e[x] )dfs(v);
}
int f[N],dep[N];
vector<vector<int>>ans;
void add(int u,int v)
{
//	cerr << "add " << u << " " <<v << endl;
	vector<int>vl,vr;
	vl.clear(),vr.clear();
	while(dep[u]>dep[v])
	{
		vl.push_back(u);
		u=f[u];
	}
	while(dep[v]>dep[u])
	{
		vr.push_back(v);
		v=f[v];
	}
	while(u!=v)
	{
		vl.push_back(u);
		vr.push_back(v);
		u=f[u],v=f[v];
	}
	vl.push_back(u);
	for ( int i = (signed)vr.size()-1 ; i >= 0 ; i-- )
		vl.push_back(vr[i]);
	ans.push_back(vl);
}
int dfs(int x,int fa)
{
//	cerr << "d " << x << " " << fa << endl;
	f[x]=fa,dep[x]=dep[fa]+1;
	int w=(is[x]?x:0);
	for ( auto v:t[x] )
	{
		if(v==fa)continue;
		int w2=dfs(v,x);
		if(w2)
		{
			if(!w)w=w2;
			else{
				add(w2,w);
				w=0;
			}
		}
	}
	return w;
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	cin >> n>> m >> k;
	for ( int i = 1 ; i <= n ; i++ )fa[i]=i;
	while(m--)
	{
		int u,v;cin >> u >> v;
		e[u].push_back(v);
		e[v].push_back(u);
	}
	while(k--){int x;cin>>x;is[x]=1;}
	for ( int i = 1 ; i <= n ; i++ )
	{
		if(!vis[i])
		{
//			cerr << i << endl;
			E.clear();
			dfs(i);
//			cerr << "D\n";
			for ( auto x:E )
			{
				int u=x.first,v=x.second;
				if(find(u)==find(v))continue;
				fa[find(u)]=find(v);
//				cerr << "add " << u << " " << v<< endl;
				t[u].push_back(v);
				t[v].push_back(u);
			}
//			cerr << "d2\n";
			dfs(i,i);
//			cerr << "ed\n";
		}
	}
	cout << ans.size() << endl;
	for ( auto x:ans )
	{
		cout << x.size() << " ";
		for ( auto y:x )cout << y << " ";
		cout << endl;
	}
	return 0;
}
/*
10 8 5
2 1
5 7
1 4
10 4
6 1
10 1
7 6
3 4
7 9 5 2 6
*/

